﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Data.SqlTypes;
using DoAnASP;

/// <summary>
/// Summary description for DAO_ThuongHieu
/// </summary>
public class DAO_ThuongHieu
{
    DAO_dataProvider kn1 = new DAO_dataProvider();

	public DataTable Load_Thuonghieu()
    {
		//ThuongHieu
        kn1.ChuoiKetNoi();
        kn1.Open_Connection();
        string sql = "Select *from ThuongHieu";
        SqlCommand cmd = new SqlCommand(sql,kn1.conn);
        DataTable dt = new DataTable();
        SqlDataReader reader = cmd.ExecuteReader();
        dt.Load(reader);
        cmd.Dispose();
        reader.Dispose();
        kn1.Close_Connection();
        return dt;
	}
    public bool ThemThuongHieu(string name)
    {
        kn1.ChuoiKetNoi();
        kn1.Open_Connection();
        string sql = "insert into ThuongHieu values ('" + name +"')";
        SqlCommand cmd = new SqlCommand(sql, kn1.conn);
        int kq = 0;
        kq = cmd.ExecuteNonQuery();
        kn1.Close_Connection();
        if (kq > 0)
            return true;

        return false;
    }
}
